namespace Guia.Elements
{
    using System.Windows.Automation;
    using Locator;

    /// <summary>
    /// This class represents a Label
    /// </summary>
    public class Label : UiElement
    {   
        /// <summary>
        /// Initializes a new instance of the Label class. 
        /// </summary>
        /// <param name="automationElement">The AutomationElement representating the Label.</param>
        public Label(AutomationElement automationElement)
            : base(automationElement)
        {
        }

        /// <summary>
        /// Gets the default-condition to find a control by its type.
        /// </summary>
        public static SearchCondition ControlTypeCondition
        {
            get { return SearchCondition.ByControlType(ControlType.Text); }
        }

        /// <summary>
        /// Gets the TextValue of the Label (the written text)
        /// </summary>
        public string TextValue
        {
            get { return this.AutomationElement.Current.Name; }
        }
    }
}